home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cuj9204 / 1004090a < prev    next >
Text File  |  1992-06-02  |  394b  |  22 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #define NUMELEMENTS(x) (sizeof(x)/sizeof(x[0]))
  6.  
  7. typedef struct {
  8.     const char *stack_name;
  9.     int *pstack;
  10.     size_t stack_ptr;
  11.     size_t max_stack;
  12. } stack;
  13.  
  14. int array1[1];
  15. static int array2[30];
  16.  
  17. stack stack1 = {"stack1", array1, 0, NUMELEMENTS(array1)};
  18. stack stack2 = {"stack2", array2, 0, NUMELEMENTS(array2)};
  19. stack stack3 = {"stack3", NULL,   0, 0};
  20.  
  21.  
  22.